<?php
/**
 * @fileName:ProductFactory.php
 * @project:miaosang
 * @author : 吐火青蛙
 * @user : 吐火青蛙
 * @date : 2020/4/10
 *
 */

namespace miaosang\basicknowledge\design\abstractfactory;

use miaosang\basicknowledge\design\abstractfactory\DigitalProduct;
use miaosang\basicknowledge\design\abstractfactory\ShippableProduct;
class ProductFactory
{
    const SHIPPING_COSTS = 50;

    public function createShippableProduct(float $price): AbstractFactory
    {
        return new ShippableProduct($price,self::SHIPPING_COSTS);
    }

    public function createDigitalProduct(float $price): AbstractFactory
    {
        return new DigitalProduct($price);
    }

}
